fix(runner): 400 for a missing bundle (#119); drop orphaned mass-VM schemas (#121) - #135
Merged
Merged
Conversation
#119: _resolve_file called .resolve(strict=True) before the 'not found' branch it documents, so a typo'd bundle raised an unhandled FileNotFoundError — a 500 from an endpoint whose docstring promises 400, and with no way for the caller to tell a bad name from a broken server. Catch it and raise the 400 the code below was already written for. Kept strict=True so the symlink semantics the traversal check relies on do not change. The dotted-name test asserted FileNotFoundError specifically, which was what made it non-vacuous; both failures are 400 now, so it asserts on the detail instead — NOT FOUND means the name was accepted. #121: removed MassDelete*/MassAction* and their Request_/Reply_ aliases, orphaned when #113 deleted the vm_ids routes. Only tests referenced them, so those go too, along with the stray module-level 'vm = MassDeleteVmItem' binding.
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #119 and #121.
#119 — a typo'd bundle name returned 500
_resolve_filecalls.resolve(strict=True), which raisesFileNotFoundErrorbefore theif not main_filepath.exists()branch further down could run — so that 400 was dead code, and the docstring's:raises HTTPException: 400 ... or the file does not existwas a lie:Pre-existing, but #113 sharpened it: with the hardcoded
/core/*routes gone, every bundle invocation goes through the arbitrary-name lookup, where a typo is the normal failure — and a 500 gives the caller no way to tell "you named something that doesn't exist" from "the server broke".Caught and translated to the 400 the code below was already written for.
strict=Trueis kept deliberately: the traversal check downstream relies on its symlink resolution, so loosening it would change a security-relevant behaviour to fix a status code.Note on the test:
test_accepts_dotted_segment_formatassertedFileNotFoundErrorspecifically — that was what made it non-vacuous, since the old regex rejected dots with a 400. Both failures are 400 now, so it asserts on the detail instead:PLAYBOOK NOT FOUNDmeans the name was accepted and only the file was missing, where the old regex would have saidINVALID ACTION NAME. Without that distinction the test would pass either way again.#121 — dead schemas from the vm_ids removal
MassDelete*/MassAction*and theirRequest_/Reply_aliases were orphaned when #113 deleted the sixvm_ids/*routes. Only tests referenced them, so those go too — along with the stray module-levelvm = MassDeleteVmItembinding.~100 lines of schema, 21 lines of test, no API surface change (the routes were already gone).
488 passed, ruff clean,
openapi.jsonregenerated — and the new drift guard from #134 now enforces that automatically.